package com.green.di.service.impl;

import com.green.di.dao.IPersonDao;
import com.green.di.entity.Person;
import com.green.di.service.IPersonService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PersonServiceImpl implements IPersonService {

    @Autowired
    private IPersonDao personDao;

    @Override
    public int addPerson() {
        return personDao.insertPerson();
    }

    @Override
    public int updatePerson() {
        return personDao.updatePerson();
    }

    @Override
    public int removePerson() {
        return personDao.removePerson();
    }

    @Override
    public List<Person> list() {
        return personDao.searchPersonList();
    }

    @Override
    public Person getInfo() {
        return personDao.searchPersonById();
    }
}
